package com.example.freewood.smartsecurity_manager.utils;

import android.app.Activity;
import android.content.Context;
import android.support.v7.app.ActionBar;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.TextView;

import com.example.freewood.smartsecurity_manager.R;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;

/**
 * Created by FreeWood on 16/3/29.
 */
public class TextActionBar {

    public TextActionBar(Context context,ActionBar actionBar,String text){
        actionBar.setDisplayShowTitleEnabled(false);
        actionBar.setDisplayShowHomeEnabled(false);
        actionBar.setDisplayShowCustomEnabled(true);
        View actionbarLayout = LayoutInflater.from(context).inflate(
                R.layout.action_text, null);
        TextView textView= (TextView) actionbarLayout.findViewById(R.id.action_all_text);
        textView.setText(text);
        actionBar.setCustomView(actionbarLayout);
    }

}
